import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/login/login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/zhuce',
      name: 'zhuc',
      component: () => import('../views/zhuce.vue'),
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../quanbu/index.vue'),
      children:[
        {
          path: '/about',
          name: 'shouye',
          component: () => import('../views/HomeView.vue'),
        },
        {
          path: '/show',
          name: 'show',
          component: () => import('../views/show.vue'),
        },
        {
          path: '/geren',
          name: 'geren',
          component: () => import('../views/geren.vue'),
        },
        {
          path: '/cart',
          name: 'cart',
          component: () => import('../views/cart.vue'),
        },
        {
          path: '/fenlei',
          name: 'fenlei',
          component: () => import('../views/fenlei.vue'),
        },
        {
          path: '/pro1',
          name: 'pro1',
          component: () => import('../views/productList.vue'),
        },
        {
          path: '/pro2',
          name: 'pro2',
          component: () => import('../views/productDetail.vue'),
        },
      ]
    },
  ],
})

export default router
